﻿Ext.override(NExt.UI.Base.Presenter.PresenterDefault, {
    initComponent: function() {
        NExt.UI.Base.Presenter.PresenterBase.superclass.initComponent.call(this);
        this.templateInitializeEvents();
        this.fireInitialize();
    },

    templateInitializeEvents: function() {
        this.addEvents('beforeInitialize', 'afterInitialize');
        this.addEvents('beforeShow', 'afterShow');
        this.addEvents('beforeClose', 'afterClose');
    },

    fireInitialize: function() {
        this.fireEvent('beforeInitialize');
        this.templateInitialize();
        this.fireEvent('afterInitialize');
    },

    templateInitialize: Ext.emptyFn,

    fireShow: function() {
        this.fireEvent('beforeShow');
        this.templateShow();
        this.fireEvent('afterShow');
    },

    templateShow: Ext.emptyFn,

    fireClose: function() {
        this.fireEvent('beforeClose');
        this.templateClose();
        this.fireEvent('afterClose');
    },

    templateClose: Ext.emptyFn
});
